<?php
namespace My\Model;

use Utuo\UtuoModel;

class GrouponModel extends UtuoModel {
	
	protected $_auto = array(
			array('begin_time', 'getBeginTime', self::MODEL_BOTH, 'callback'),
			array('end_time', 'getEndTime', self::MODEL_BOTH, 'callback'),
	);
	
	/**
	 * 开始时间
	 * @return boolean|number
	 */
	public function getBeginTime() {
		$beginTime = I("begin_time");
		if(!isset($_REQUEST['begin_time'])) return false;
		return strtotime($beginTime);
	}
	
	/**
	 * 结束时间
	 * @return boolean|number
	 */
	public function getEndTime() {
		$endTime = I("end_time");
		if(!isset($_REQUEST['end_time'])) return false;
		return strtotime($endTime);
	}
	
}